<template>
  <div>
    <!-- <button @click="delFn(10)">-</button> -->
    <button @click="add">+</button>
    <span>{{ value }}</span>
    <!-- <button @click="addFn(10)">+</button> -->
    <button @click="del">-</button>
  </div>
</template>

<script>
export default {
  methods: {
    add() {
      this.$emit('input', this.value + 1)
    },
    del() {
      this.$emit('input', this.value - 1)
    },
  },
  props: {
    value: {
      type: Number,
      required: true,
    },
  },
}
</script>

<style lang="less" scoped>
span {
  display: inline-block;
  margin: 0 5px;
}
</style>
